package main

import (
	"fmt"
	"math/rand"
)

func num() string {
	// m1 := map[int]int32{1: '1', 2: '2', 3: '3', 4: '4'}
	// m2 := map[int32]int{}
	// m3 := ""
	// for len(m2) < 3 {
	// 	randNum := rand.Intn(4)
	// 	m2[m1[randNum+1]] = randNum
	// }
	// for k := range m2 {
	// 	m3 += string(k)
	// }
	// return m3

	nums1 := []rune{'1', '2', '3', '4'}
	nums2 := map[rune]int{}
	s1 := []rune{}
	for len(nums2) < 3 {
		index := rand.Intn(4)
		nums2[nums1[index]] = index
	}
	for k := range nums2 {
		s1 = append(s1, k)
	}
	str := string(s1)
	return str
}

func numList() {
	fmt.Printf("4个数字取出3个数字有%v种可能性。\n", 4*3*2)
	strMap := map[string]string{}
	for len(strMap) < 24 {
		str := num()
		strMap[str] = str
	}
	for _, v := range strMap {
		fmt.Printf("%v ", v)
	}
	fmt.Println()
}
